<?php
/* 
 * ebiz front
 * 
 * Item Metadata Model
 * 
 * @author allen
 * 
 */

require_once '../app/core/models/BaseDao.php';
require_once '../app/core/db/DBUtil.class.php';

class ItemMetadataDao extends BaseDao 
{ 
    private $tableName ="item_metadatas";
	 
    /**
     * show in product page
     */
 	public function getMetadataInputTypeByItemId($itemId){
 		$param = array($itemId);
    	$sql="select  im.product_item_id ,  m.title , m.input_type ,  im.value , im.desc_value , m.is_primary  ,  m.group_id 
				from  $this->tableName im
				join metadatas m on m.id = im.metadata_id
				where im.product_item_id = ? and m.show_in_product = 1 and im.is_delete = 0";
    	return $this->dbUtil->SelectData($sql, $param);
    }
    
}